package org.jtb.quickr;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.log4j.Logger;

class SignedMethodUrl extends SignedUrl {
    private String method;
    
    private static Logger logger = Logger.getLogger(SignedMethodUrl.class.getName());  
    
    public SignedMethodUrl(String baseUrl, String apiKey, String secret, String method) throws QuickrException {
        this(baseUrl, new HashMap<String,String>(), apiKey, secret, null, method);
    }

    public SignedMethodUrl(String baseUrl, String apiKey, String secret, AuthResponse.Token authToken, String method) throws QuickrException {
        this(baseUrl, new HashMap<String,String>(), apiKey, secret, authToken, method);
    }
    
    public SignedMethodUrl(String baseUrl, Map<String,String> args, String apiKey, String secret, String method) throws QuickrException {
        this(baseUrl, args, apiKey, secret, null, method);
    }

    public SignedMethodUrl(String baseUrl, Map<String,String> args, String apiKey, String secret, AuthResponse.Token authToken, String method) throws QuickrException {
        super(baseUrl, args, apiKey, secret, authToken);
        this.method = method;
    }
    
    protected Map<String,String> getArgs() {
        putArg("method", method);
        
        return super.getArgs();
    }        
    
}
